#include<stdio.h>
#include<stdlib.h>

void Matrix(int **m1,int **m2, int **re, int r1,int c1, int c2)
{
	int i,j,k;
	for(i = 0; i < r1; i++){
		for(j = 0; j < c2; j++){
			*((int*)re + c2*i + j) = 0;
			for(k = 0; k < c1; k++){
				*((int*)re + c2*i + j) += *((int*)m1+c1 * i + k) * *((int*) m2+c2*k+j);
			}
		}
	}

}

int main(){
	int i,j;
	int a[2][3] = {1,2,3, 4,5,6};
	int b[3][2] = {1,2, 3,4, 5,6};
	int des[2][2];
	Matrix((int**)a,(int**)b,(int**)des,2,3,2);
	for(i = 0; i < 2; i++){
		for(j = 0; j< 2; j++)
			printf("%d,",des[i][j]);
		printf("\n");
	}

}
